

import Foundation


struct WeakRef<T: AnyObject> {

    weak var object: T?

    var description: String {
        if let object = object {
            return "Weak(" + String(reflecting: object) + ")"
        } else {
            return "nil"
        }
    }

    init(_ object: T?) {
        self.object = object
    }

    init() {
        object = nil
    }
}
